import pygame
import sys

WINDOW_WIDTH = 300
WINDOW_HEIGHT = 300

init_result = pygame.init()
# print(init_result)

# Create a window
screen = pygame.display.set_mode((WINDOW_HEIGHT, WINDOW_WIDTH))
screen.fill((0, 0, 0))
GOLD = 255, 251, 0
RED = pygame.Color('red')
ball = pygame.image.load('PYG02-ball.gif')
ballrect = ball.get_rect()
fclock = pygame.time.Clock()

# Set title
# pygame.display.set_caption('new pygame')
speedx = 10
speedy =10
game_running = True
while game_running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            print(event.type)
            game_running = False
    screen.fill((0, 0, 0))
    ballrect = ballrect.move(speedx, speedy)
    print(f"ballrect:{ballrect.bottomleft}")
    screen.blit(ball, ballrect)
    pygame.display.update()
    fclock.tick(10)
pygame.quit()
sys.exit()
